package de.tabuma.pm.externalproject.view;

import de.tabuma.pm.*;
import de.tabuma.pm.externalproject.entity.*;
import de.tabuma.lib.tabumaview;
import java.io.PrintWriter;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

/**
 *
 * @author alefen
 */
public class remove extends tabumaview {

    public remove(String servlet, Hashtable parameter) {
        super(servlet, parameter);
    }

    @Override
    public void processRequest(ServletContext context, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
        String question = "Do you really want to remove project {1}?";
        String remove = "remove";
        String cancel = "cancel";

        ExternalProject ep = (ExternalProject) request.getAttribute(constants.externalProject);

        out.println(question.replaceAll("\\{1\\}", ep.getName()));
        out.println(this.getFormBeginn(null));
        out.println(this.getHiddenAsAttribute());
        out.println("<input type=\"hidden\" name=\""+constants.externalProjectId+"\" value=\""+ep.getId()+"\"/>");
        out.println("<input type=\"hidden\" name=\""+constants.removeExternalProject1+"\" value=\"true\"/>");
        out.println("<input type=\"submit\" name=\"remove\" value=\""+remove+"\" class=\"button\"/>");
        out.println("<input type=\"button\" name=\"back\" value=\""+cancel+"\" onClick=\"javascript:history.back()\" class=\"button\"/>");
        out.println(this.getFormEnd());
    }
}